function deepCopy(_obj: any) {
    let obj: any;
    if (Array.isArray(_obj)) {
        obj = [];
    } else if (_obj.__proto__.constructor == Map) {
        obj = new Map;
    } else if (_obj.__proto__.constructor == Set) {
        obj = new Set;
    } else {
        obj = {};
    }
    for (let key in _obj) {
        if (Array.isArray(_obj[key])) {
            obj[key] = (deepCopy(_obj[key]))
        } else if (typeof _obj[key] === 'object') {
            obj[key] = deepCopy(_obj[key]);
        } else {

            obj[key] = _obj[key];
        }
    }
    obj.__proto__ = _obj.__proto__;
    return obj;
}

export {
    deepCopy
}